package com.atguigu.gmall.activity.controller;

import com.atguigu.gmall.activity.service.SeckillGoodsService;
import com.atguigu.gmall.model.activity.SeckillGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: 李旭
 * @create: 2021-09-17 15:31
 *
 *   秒杀商品
 **/
@RestController
@RequestMapping("/api/activity/seckill")
public class SeckillGoodsApiController {

    @Autowired
    private SeckillGoodsService seckillGoodsService;

    //秒杀频道页面 秒杀商品集合
    @GetMapping("/list")
    public List<SeckillGoods> getSeckillGoodsList(){
        return seckillGoodsService.getSeckillGoodsList();
    }
    //根据skuId查询一个秒杀商品
    @GetMapping("/getItem/{skuId}")
    public SeckillGoods getItem(@PathVariable String skuId){
        return seckillGoodsService.getItem(skuId);
    }



}
